package com.sky.controller.users;

import com.sky.context.BaseContext;
import com.sky.dto.ExerciseDTO;
import com.sky.result.Result;
import com.sky.service.ExerciseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/exercise")
@Api(tags = "运动目标相关接口")
public class ExerciseController {
    @Autowired
    private ExerciseService exerciseService;;
    @PostMapping("/addPlan")
    @ApiOperation(value = "添加每日运动目标接口")
    public Result insertPlan(@RequestBody ExerciseDTO exerciseDTO){
        exerciseDTO.setId(BaseContext.getCurrentId());
        exerciseService.addPlan(exerciseDTO);
        return Result.success();
    }
}
